Use named ACLs to avoid exceeding HAProxy's 64-word parser limit#460
Open
Use named ACLs to avoid exceeding HAProxy's 64-word parser limit#460
Conversation
Split the inline OR-chained ACL conditions in the redirect rule into separate named ACL lines (do_not_redirect). In HAProxy, multiple ACL lines with the same name are OR'd together, preserving the same logic while keeping each line short. Also refactor the HSTS template to use a named is_allow_http ACL to avoid the same potential word-limit issue. Agent-Logs-Url: https://github.com/canonical/haproxy-operator/sessions/0787275c-fa4f-4c2a-8201-ad38184c5afc Co-authored-by: Thanhphan1147 <42444001+Thanhphan1147@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/haproxy-operator/sessions/0787275c-fa4f-4c2a-8201-ad38184c5afc Co-authored-by: Thanhphan1147 <42444001+Thanhphan1147@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix template redirect line exceeding HAProxy's 64-word limit
Use named ACLs to avoid exceeding HAProxy's 64-word parser limit
Apr 13, 2026
…ules Agent-Logs-Url: https://github.com/canonical/haproxy-operator/sessions/9fcbfc56-eb9e-4fd1-9702-50a10c317953 Co-authored-by: Thanhphan1147 <42444001+Thanhphan1147@users.noreply.github.com>
seb4stien
approved these changes
Apr 15, 2026
Contributor
Test results for commit fc19f42Test coverage for fc19f42 Static code analysis report |
Contributor
Test results for commit fc19f42Test coverage for fc19f42 Static code analysis report |
Contributor
Test results for commit fc19f42Test coverage for fc19f42 Static code analysis report |
Contributor
Test results for commit fc19f42Test coverage for fc19f42 Static code analysis report |
Contributor
Test results for commit fc19f42Test coverage for fc19f42 Static code analysis report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When multiple haproxy-route relations provide
allow_httpdata, the template concatenates all ACLs into a singlehttp-request redirectline using||operators. With 7+ relations this exceeds HAProxy's hardcoded 64-word per-line parser limit, causing config validation failures.Changes
haproxy_route.cfg.j2): Replace inline OR-chained ACLs with a single namedis_allow_httpACL. HAProxy implicitly ORs multipleacllines sharing the same name, so each relation gets its own short line. The ACL is defined once and reused in both the redirect and HSTS rules:is_allow_httpACL to prevent the identical word-limit issue on thehttp-response set-headerline, avoiding duplicate ACL definitions.test_hsts_disabled_allow_httpassertion to match new output format. Addedtest_redirect_without_allow_http_uses_named_aclandtest_redirect_allow_http_uses_named_acl.